<?php

namespace Model;
use Think\Model;
//为sw_goods数据表创建一个Model模型类
//父类model：Think/library/think/model.class.php
class UserModel extends Model{

    //记录登录时间，登录次数
    function timesave(){
        $user_id = session('user_id');
        $info = $this->find($user_id);

        $info['user_time'] += 1;
        $info['last_time'] = NOW_TIME;

        $this->save($info);

    }

}